`timescale 1ns / 1ns
module tb_BtnSwitchLED ();
    // Testbench signals
    reg sys_clk;
    reg sys_rst_n;
    reg [1:0] keys;
    wire [1:0] led;

    // Instantiate the DUT
    BtnSwitchLED #(
                     // 为提高仿真速度,降低计数值
                     .MaxCount(32'd25-32'd1),
                     .KeyHoldTime(32'd1)
                 ) dut (
                     .sys_clk(sys_clk),
                     .sys_rst_n(sys_rst_n),
                     .keys(keys),
                     .led(led)
                 );

    // Clock generation
    initial begin
        sys_clk <= 0;
        forever
            #10 sys_clk <= ~sys_clk;  // 50MHz clock
    end

    // Stimulus generation
    initial begin
        // Initialize inputs
        sys_rst_n <= 0;
        keys <= 2'b11;

        // Release reset
        #1000 sys_rst_n <= 1;

        // Test case 1: Key0 pressed
        #1000 keys <= 2'b10;
        #100 keys <= 2'b11;

        // Test case 2: Key1 pressed
        #10000 keys <= 2'b01;
        #100 keys <= 2'b11;
    end

endmodule
